package com.lxx.product.controller;

import com.lxx.product.pojo.User;
import com.lxx.product.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author liuxing
 * @create 2022-08-27 0:15
 */
@RestController
@RequestMapping("/product")
public class UserController {

    @Autowired
    private UserServiceImpl userService;


    @ResponseBody
    @GetMapping("user/{id}")
    public User getById(@PathVariable("id") Long id){
        // int i = 1/0;
        User user = userService.getUserById(id);
        return user;
    }
}
